/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package lesson3.com.demo.lang;


public class StringBuilderExample {
    private int fieldOne;
    private String fieldTwo;
    
    private StringBuffer buffer = new StringBuffer();
    
    public void f(){
        buffer.append("Hi");
    }
    
    @Override
    public String toString(){
        StringBuilder builder = new StringBuilder();
        builder.append("Field one has value");
        builder.append(fieldOne);
        builder.append(" , fieldTwo has a value of ");
        builder.append(fieldTwo);
        return builder.toString();
    }
    
    public static void main(String[] args){
        StringBuilderExample sbe = new StringBuilderExample();
        sbe.fieldOne=77;
        sbe.fieldTwo="Hello World";
        System.out.println(sbe);
    }
}
